package com.lsu.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lsu.app.bean.TimeTable;
import com.lsu.app.service.TimeTableService;
import com.lsu.app.mapper.TimeTableMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @description 针对表【time_table(课程时间表)】的数据库操作Service实现
 * @Date 2023-11-07 18:33:21
 * @author hjj
 */
@Service
public class TimeTableServiceImpl extends ServiceImpl<TimeTableMapper, TimeTable> implements TimeTableService{
        private final TimeTableMapper mapper;

    public TimeTableServiceImpl(TimeTableMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public void copySc(Integer scId, Integer newScId) {
        for (TimeTable timeTable : mapper.copySc(scId)) {
            timeTable.setScheduleId(newScId);
            mapper.insert(timeTable);
        }
    }
}




